package com.plian.system.wrapper.lg;

import com.plian.system.dto.lg.MlegalProceedingsArbitrationDTO;
import com.plian.system.entity.lg.MlegalProceedingsArbitration;
import com.plian.system.mybatis.support.BaseWrapper;
import com.plian.system.vo.lg.MlegalProceedingsArbitrationVO;
import com.plian.system.wrapper.util.CacheWrapperUtil;
import com.plian.system.wrapper.util.WrapperUtil;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import static com.plian.system.wrapper.util.WrapperConstant.*;

/**
 * 包装类,返回视图层所需的字段
 *
 * @author gangan
 * @since 2019-09-27
 */
@Mapper(componentModel = SPRING, uses = {CacheWrapperUtil.class, WrapperUtil.class})
public interface MlegalProceedingsArbitrationWrapper extends BaseWrapper<MlegalProceedingsArbitration, MlegalProceedingsArbitrationDTO, MlegalProceedingsArbitrationVO> {

	/**
	 * Entity转VO
	 *
	 * @param entity /
	 * @return /
	 */
	@Override
	@Mappings(value = {
			@Mapping(source = "fillingUnitId", target = "fillingUnitName", qualifiedByName = ORG_ID_TO_NAME),
			@Mapping(source = "createUser", target = "createUserName", qualifiedByName = USER_ID_TO_NAME),
			@Mapping(source = "updateUser", target = "updateUserName", qualifiedByName = USER_ID_TO_NAME),
			@Mapping(source = "approvedUser", target = "approvedUserName", qualifiedByName = USER_ID_TO_NAME),
			@Mapping(source = "superiorGroupId", target = "superiorGroupName", qualifiedByName = PROPERTY_ID_NAME)
	})
	MlegalProceedingsArbitrationVO entityToVO(MlegalProceedingsArbitration entity);
}
